<?php
include_once 'autoload.php';
include_once __DIR__ . "/../router/web.php";

use System\Container;
use System\Route;

$path = Route::$path;
$pathIndex = [];
foreach ($path as $p) {
    if ($p["url"] == $_SERVER["PATH_INFO"]) {
        echo (new Container())->call($p["path"][0], $p["path"][1]);
        break;
    }
}
if(!$pathIndex){
    header("HTTP/1.1 404 Not Found");
    echo "404 Not found";
}